class CmdRemoveSelected:
    def __init__(self, diagram_view, views):
        self.diagram_view = diagram_view
        #Backing up affected views
        self.affected_views = [v for v in views if v.is_selected()]

    def execute(self):
        for v in self.affected_views:
            self.diagram_view.remove_view(v)
        self.diagram_view.redraw()
    
    def reverse(self):
        for v in self.affected_views:
            self.diagram_view.add_view(v)
        self.diagram_view.redraw()
